<?php
/**
 * ============================================================================
 * 版权所有 2008-2011 多多网络，并保留所有权利。
 * 网站地址: http://soft.duoduo123.com；
 * ----------------------------------------------------------------------------
 * 这不是一个自由软件！您只能在不用于商业目的的前提下对程序代码进行修改和
 * 使用；不允许对程序代码以任何形式任何目的的再发布。
 * ============================================================================
*/
session_start();
error_reporting(0);
include_once 'comm/config.php';
include 'comm/class_db.php';
include_once 'comm/checkpostandget.php';
include_once 'comm/page.class.php';
include 'data/expression.php';
$shai_set=include 'data/shai.php';
$shaicat_arr=$shai_set['shai_cat'];
$key=$_GET['key'];
$id=intval($_GET['id']);
$catid=intval($_GET['catid']);
$sort=$_GET['sort']?$_GET['sort']:'id';

if($catid>0) $where="where catid='".$catid."'";
elseif($catid==0) $where="where 1=1";

$order="order by ".$sort." desc";

$page = !($_GET['page'])?'1':intval($_GET['page']);
$pagesize=24;
$page2=($page-1)*$pagesize;

$sql="select id from ".$BIAOTOU."shai $where and title like '%".$key."%'";
$query=mysql_query($sql);
$total=mysql_num_rows($query);

$sql="select `id`,`title`,`ddusername`,`image`,`hart`,`hits`,`comment`,`dduserid`,`time` from ".$BIAOTOU."shai $where and title like '%".$key."%' $order limit $page2,$pagesize";
$query=mysql_query($sql);
$i=0;
while($row=mysql_fetch_array($query)){
    $shaidan_arr[$i]=$row;
	$shaidan_arr[$i]['comment']=preg_replace('/{(.*?)}/','',$row['comment']);
	$i++;
}

if($_SESSION["dduserlevel"]<$shai_set['limit_level']){
    $buyid=0;
}
else{
    $buyid=1;
}

//$xs=$xs?$xs:'share';
$tag='shai';
$pagetag='baobeilist';
include_once 'comm/wjt.php';
include_once 'comm/seo.php';
//引入模版文件
include 'template/'.MOBAN.'/baobeilist.tpl.php';
mysql_close();
?>